﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="NewCourse.aspx.cs" Inherits="CourseScheduling.NewCourse" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 266px;
        }
        .style2
        {
            width: 269px;
        }
        .style3
        {
            text-decoration: underline;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <table width=100%>
            <tr valign=top>
            <td class="style1">
            
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                    DeleteCommand="DELETE FROM [Course] WHERE [CourseNumber] = @original_CourseNumber AND [CourseName] = @original_CourseName AND [OddFall] = @original_OddFall AND [EvenSpring] = @original_EvenSpring AND [EvenFall] = @original_EvenFall AND [OddSpring] = @original_OddSpring" 
                    InsertCommand="INSERT INTO [Course] ([CourseNumber], [CourseName], [OddFall], [EvenSpring], [EvenFall], [OddSpring]) VALUES (@CourseNumber, @CourseName, @OddFall, @EvenSpring, @EvenFall, @OddSpring)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT * FROM [Course]" 
                    UpdateCommand="UPDATE [Course] SET [CourseName] = @CourseName, [OddFall] = @OddFall, [EvenSpring] = @EvenSpring, [EvenFall] = @EvenFall, [OddSpring] = @OddSpring WHERE [CourseNumber] = @original_CourseNumber AND [CourseName] = @original_CourseName AND [OddFall] = @original_OddFall AND [EvenSpring] = @original_EvenSpring AND [EvenFall] = @original_EvenFall AND [OddSpring] = @original_OddSpring">
                    <DeleteParameters>
                        <asp:Parameter Name="original_CourseNumber" Type="String" />
                        <asp:Parameter Name="original_CourseName" Type="String" />
                        <asp:Parameter Name="original_OddFall" Type="Boolean" />
                        <asp:Parameter Name="original_EvenSpring" Type="Boolean" />
                        <asp:Parameter Name="original_EvenFall" Type="Boolean" />
                        <asp:Parameter Name="original_OddSpring" Type="Boolean" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CourseNumber" Type="String" />
                        <asp:Parameter Name="CourseName" Type="String" />
                        <asp:Parameter Name="OddFall" Type="Boolean" />
                        <asp:Parameter Name="EvenSpring" Type="Boolean" />
                        <asp:Parameter Name="EvenFall" Type="Boolean" />
                        <asp:Parameter Name="OddSpring" Type="Boolean" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="CourseName" Type="String" />
                        <asp:Parameter Name="OddFall" Type="Boolean" />
                        <asp:Parameter Name="EvenSpring" Type="Boolean" />
                        <asp:Parameter Name="EvenFall" Type="Boolean" />
                        <asp:Parameter Name="OddSpring" Type="Boolean" />
                        <asp:Parameter Name="original_CourseNumber" Type="String" />
                        <asp:Parameter Name="original_CourseName" Type="String" />
                        <asp:Parameter Name="original_OddFall" Type="Boolean" />
                        <asp:Parameter Name="original_EvenSpring" Type="Boolean" />
                        <asp:Parameter Name="original_EvenFall" Type="Boolean" />
                        <asp:Parameter Name="original_OddSpring" Type="Boolean" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <asp:Label ID="CourseInfo" runat="server" Text="Enter New Course Information" 
                    style="font-weight: 700; text-decoration: underline"></asp:Label>
                <br />
                <br />
                <asp:Label ID="Cname" runat="server" Text="Course Name:"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <br />
                <br />
                <asp:Label ID="Cnumber" runat="server" Text="Course Number:"></asp:Label>
&nbsp;<br />
&nbsp;<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <br />
                <br />
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Odd Fall" />
                <br />
                <asp:CheckBox ID="CheckBox2" runat="server" Text="Even Spring" />
                <br />
                <asp:CheckBox ID="CheckBox3" runat="server" Text="Even Fall" />
                <br />
                <asp:CheckBox ID="CheckBox4" runat="server" Text="Odd Spring" />
                <br />
                <br />
                <asp:Button ID="addIt" runat="server" onclick="addCourse_Click" 
                    Text="Add Course to Catalog" />
            
                <br />
                <br />
            
            </td>
            <td class="style2">
                &nbsp;</td>
            <td>
                
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                    DeleteCommand="DELETE FROM [CourseProgJunction] WHERE [CourseNumber] = @CourseNumber AND [ProgramID] = @ProgramID" 
                    InsertCommand="INSERT INTO [CourseProgJunction] ([CourseNumber], [ProgramID]) VALUES (@CourseNumber, @ProgramID)" 
                    SelectCommand="SELECT * FROM [CourseProgJunction]">
                    <DeleteParameters>
                        <asp:Parameter Name="CourseNumber" Type="String" />
                        <asp:Parameter Name="ProgramID" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CourseNumber" Type="String" />
                        <asp:Parameter Name="ProgramID" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
                <strong>
                <br class="style3" />
                <asp:Label ID="AddCourceProgramTrack" runat="server" 
                    Text="Add Course to a Program Track" CssClass="style3"></asp:Label>
                </strong>
                <br />
                <br />
                <asp:Label ID="Label1" runat="server" Text="Course Number:  "></asp:Label>
&nbsp;
                <asp:DropDownList ID="DropDownList1" runat="server" 
                    DataSourceID="SqlDataSource1" DataTextField="CourseNumber" 
                    DataValueField="CourseNumber">
                </asp:DropDownList>
&nbsp;<br />
                <br />
                <asp:Label ID="Label2" runat="server" Text="Program Track:  "></asp:Label>
                &nbsp;&nbsp;
                <asp:DropDownList ID="DropDownList2" runat="server">
                    <asp:ListItem Value="CS">Computer Science</asp:ListItem>
                    <asp:ListItem Value="IS">Information Science</asp:ListItem>
                    <asp:ListItem Value="IT">Information Technology</asp:ListItem>
                </asp:DropDownList>
                <br />
                <br />
                <br />
                <asp:Button ID="Button1" runat="server" onclick="progTrack_Click" 
                    Text="Add Course to Program" />
                <br />
            
            </td>
            <td>
            </td>
            </tr>
    </table>
</asp:Content>
